﻿#region << 文 件 说 明 >>
/*----------------------------------------------------------------
// 文件名称：aaViewModel
// 创 建 人：YangCheng
// 创建时间：2022/6/6 17:26:05
// 文件版本：V1.0.0
// ===============================================================
// 功能描述：
//		
//
//----------------------------------------------------------------*/
#endregion

using CommunityToolkit.Mvvm.Input;
using HandyControl.Controls;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Vampirewal.Core;
using Vampirewal.Core.ConfigOptions;
using Vampirewal.Core.Interface;
using Vampirewal.Core.SimpleMVVM;
//using Vampirewal.Core.VContainer;

namespace test.View2
{
    /// <summary>
    /// 
    /// </summary>
    //[VampirewalIoCRegister("aaViewModel", RegisterType.ViewModel)]
    public class aaViewModel:ViewModelBase
    {
        private IVampirewalCoreDialogMessage Dialog { get; set; }
        public aaViewModel(IVampirewalCoreDialogMessage dialog)
        {
            Dialog = dialog;
            //构造函数
            aatests = new ObservableCollection<aatest>();

            //for (int i = 0; i < 10; i++)
            //{

            //    var aaa = new aatest()
            //    {
            //        aaName = $"a{i}"
            //    };
            //    if (i < 5)
            //    {
            //        aaa.sort = 1;
            //    }
            //    else
            //    {
            //        aaa.sort = 2;
            //    }

            //    aatests.Add(aaa);
            //}

            var aaa= VampirewalCoreContext.GetInstance().GetOptions<AppBaseOptions>();
        }

        public override object GetResult()
        {
            return null;
        }

        #region 属性
        public ObservableCollection<aatest> aatests { get; set; }
        #endregion

        #region 公共方法

        #endregion

        #region 私有方法

        #endregion

        #region Command命令
        public RelayCommand aaCommand => new RelayCommand(() => 
        {
            //Dialog.ShowPopupWindow("hahaa",WindowsManager.GetInstance().GetDialogWindow(ViewId), Vampirewal.Core.WpfTheme.WindowStyle.MessageType.Successful);

            CloseView();
        });

        protected override void CloseView()
        {
            WindowsManager.GetInstance().CloseDialogWindow(ViewId);
        }
        #endregion
    }

    public class aatest
    {
        public string aaName { get; set; }

        public int sort { get; set; }
    }
}
